<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="${contextPath}/admin/stylesheets/common.css?v=${sversion}" media="screen" />
	<link rel="stylesheet" type="text/css" href="${contextPath}/admin/stylesheets/table.css?v=${sversion}" media="screen" />
	<script type="text/javascript" src="${contextPath}/ext/jquery/jquery-1.8.1.min.js"></script>
	<script type="text/javascript" src="${contextPath}/ext/jquery_form/jquery.form.min.js"></script>
	<script type="text/javascript" src="${contextPath}/ext/layer/layer.min.js"></script>
	<script type="text/javascript" src="${contextPath}/ext/laydate/laydate.js"></script>
	
	
	<script type="text/javascript" src="${contextPath}/admin/ext/jquery/selectbox.js"></script>
	<script type="text/javascript" src="${contextPath}/admin/ext/zw/check.js?v=${sversion}"></script>
	<script type="text/javascript" src="${contextPath}/admin/javascripts/zcommon.js?v=${sversion}" basepath="${contextPath}" baseinit="ajaxCheckLogin"></script>

</head>
<body>
<div class="place">
    <span class="label-span">位置：</span>
    <ul id="place-list" class="place-ul">
        <li>系统设置 - 行为日志</li>
    </ul>
</div>
<div class="body-warp">
    <div class="panel">
        <div class="panel-title">
            <i class="form-icon"></i>
            <span class="title-text">日志保存时间设置</span>
        </div>
        <div class="panel-body">
		    <form id="saveform" method="post">
		    	<input type="hidden" value="${(obj.id)!}" name="id">
		        <table class="form-table">
			        <tr>
		                <td><label class="form-label">保存时间(天)</label></td>
		                <td>
		                	<input class="form-control" name="day" type="text" data-check="n|max-len:8" id="day"  value="${(obj.day)!}"/>
		                </td>
		            </tr>
		            <tr>
		                <td><label class="form-label">&nbsp;</label></td>
		                <td>
		                    <input class="btn btn-success btn-large" type="button" onclick="_save()" value="提交">
		                    <input class="btn btn-danger btn-large" type="reset" value="重置">
		                </td>
		            </tr>
		        </table>
		    </form>
        </div>
    </div>
</div>
<script type="text/javascript">
var prefix = "${contextPath}";

function _save() {

	
	$("#saveform").ajaxSubmit({
		url : '${contextPath}/log/setTime.ajax',
		dataType : 'json',
		beforeSubmit : function(formData, jqForm, options) {
			if(!$("#saveform").check())return false;

			if (!isInteger($('#day').val())) {
				alert('请输入正整数');
				return false;
			}
			if(!window.confirm("确定提交?"))return false;
		    return true;
		},
		success : function(data, statusText, xhr) {
			if(data.s){
				z_alert_success(data.d||"操作成功！");
			}else{
				z_alert_error(data.d);
			}
		    return true;
		}
	});
	
	function isInteger(obj) {
		if (obj == '') {
			return true; 
		}
 		return obj > 0 && obj%1 === 0;
	}
}

$(document).ready(function(){
	
});
</script>
</body>
</html>